import { ResponseData } from '@/http/types';

export interface PaperQuestion {
  id: number;
  score: number;
  sequence: number;
}

export interface ProgrammingProblem {
  _id: string;
  title: string;
  sequence?: number;
  score?: number;
}

export interface Paper {
  id: number;
  _id: string;
  title: string;
  description: string;
  duration: number;
  total_score: number;
  passing_score: number;
  start_time: string | null;
  end_time: string | null;
  is_public: boolean;
  show_score_after_submit: boolean;
  show_answer_after_submit: boolean;
  random_order: boolean;
  questions: PaperQuestion[];
  problems?: ProgrammingProblem[];
  created_at: string;
  updated_at: string;
}

export interface PaperListResponse {
  count: number;
  next: string | null;
  previous: string | null;
  results: Paper[];
}

export interface CreatePaperRequest {
  title: string;
  description: string;
  duration: number;
  total_score: number;
  passing_score: number;
  start_time: string | null;
  end_time: string | null;
  is_public: boolean;
  show_score_after_submit: boolean;
  show_answer_after_submit: boolean;
  random_order: boolean;
  questions: PaperQuestion[];
  programmingProblems?: ProgrammingProblem[];
}

export type PaperResponse = ResponseData<Paper>;
export type PaperListApiResponse = ResponseData<PaperListResponse>;